//
//  DeviceTools.m
//  CommonLib
//
//  Created by dev on 13-7-15.
//  Copyright (c) 2013年 boxfishedu. All rights reserved.
//

#import "DeviceTools.h"

@implementation DeviceTools

+ (BOOL)isPhone
{
    return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
}

+ (BOOL)isPad
{
    return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
}

+ (BOOL)is4InchPhone
{
    return ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
    && 568 == [UIScreen mainScreen].bounds.size.height);
}

+ (BOOL)is3p5InchPhone
{
    return ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
            && 480 == [UIScreen mainScreen].bounds.size.height);
}

+ (BOOL)isSimulator
{
    return ([[[UIDevice currentDevice].model lowercaseString] rangeOfString:@"simulator"].location != NSNotFound);
}
@end
